﻿
namespace FluentSpring
{
    public class ConfigStep
    {
        private ConfigContext configContext;

        public ConfigStep(ConfigContext ctx)
        {
            configContext = ctx;
        }

        public IDependencyStep BindCtorArg()
        {
            return new ConstructorDependencyStep(configContext, this);
        }

        public IDependencyStep BindProperty(string propertyName)
        {
            return new PropertyDependencyStep(propertyName, configContext, this);
        }

        public ConfigStep SetSingleton()
        {
            configContext.BuilderActionList.Add(builder => builder.SetSingleton(true));
            return this;
        }

        public ConfigStep SetPrototype()
        {
            configContext.BuilderActionList.Add(builder => builder.SetSingleton(false));
            return this;
        }

        public ConfigStep SetLazyInit()
        {
            configContext.BuilderActionList.Add(builder => builder.SetLazyInit(true));
            return this;
        }


    }
}
